home *** CD-ROM | disk | FTP | other *** search
- Path: rcp6.elan.af.mil!rscernix!danpop
- From: danpop@mail.cern.ch (Dan Pop)
- Newsgroups: comp.lang.c
- Subject: Re: Is it possible to have one Makefile for several compilers?
- Date: 17 Feb 96 21:58:46 GMT
- Organization: CERN European Lab for Particle Physics
- Message-ID: <danpop.824594326@rscernix>
- References: <31249363.1664@ivab.se>
- NNTP-Posting-Host: ues5.cern.ch
- X-Newsreader: NN version 6.5.0 #7 (NOV)
-
- In <31249363.1664@ivab.se> Goran_Wireen@ivab.se (Goran Wireen) writes:
-
- >I would like to use the same Makefile for different compilers
- >(Gnu C/C++, Unix cc, CXX). I was hoping that I easily could
- >select compiler by calling e.g:
- >
- > make gcc all
- >
- >and by using a Makefile that looks something like this:
- >
- > # Default compiler is cc
- > CC = cc
- >
- > cxx:
- > CC = cxx
- >
- > gcc:
- > CC = gcc
- >
- > all:
- > $(CC) $(CFLAGS_AND_STUFF) $(SOURCES) ...
- >
- >But as you can assign macros in the command lines below cxx: and
- >gcc: this won't work.
- >
- >Does anybody have any idea how I can select compiler in a simple
- >way?
-
- The simplest way I can think of is:
-
- make CC=gcc all
-
- Dan
- --
- Dan Pop
- CERN, CN Division
- Email: danpop@mail.cern.ch
- Mail: CERN - PPE, Bat. 31 R-004, CH-1211 Geneve 23, Switzerland
-